home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / patches / ami301c.zip / BUILDER.SA$ / BUILDER.SAM
INI File  |  1993-05-18  |  19KB  |  1,377 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     QMS-PS 810
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     This is the template for the build.smm macro.
  19.     
  20.     
  21.     
  22.     
  23.     737753952
  24.     5
  25.     736633139
  26.     9
  27.     8
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     1
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [ParaNum]
  54.     1
  55. [tag]
  56.     Body Text
  57.     2
  58.     [fnt]
  59.         Times New Roman
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         33
  71.         273
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         2
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         280
  103.         1
  104.         2
  105.         .
  106.         ,
  107.         $
  108.     Body Text
  109.     0
  110.     0
  111. [tag]
  112.     Body Single
  113.     3
  114.     [fnt]
  115.         Times New Roman
  116.         240
  117.         0
  118.         49152
  119.     [algn]
  120.         1
  121.         1
  122.         0
  123.         0
  124.         0
  125.     [spc]
  126.         33
  127.         273
  128.         1
  129.         0
  130.         0
  131.         1
  132.         100
  133.     [brk]
  134.         4
  135.     [line]
  136.         8
  137.         0
  138.         1
  139.         0
  140.         1
  141.         1
  142.         1
  143.         10
  144.         10
  145.         1
  146.     [spec]
  147.         0
  148.         0
  149.         
  150.         0
  151.         1
  152.         1
  153.         0
  154.         0
  155.         0
  156.         0
  157.     [nfmt]
  158.         280
  159.         1
  160.         2
  161.         .
  162.         ,
  163.         $
  164.     Body Single
  165.     0
  166.     0
  167. [tag]
  168.     Bullet
  169.     4
  170.     [fnt]
  171.         Times New Roman
  172.         240
  173.         0
  174.         49152
  175.     [algn]
  176.         1
  177.         1
  178.         0
  179.         288
  180.         288
  181.     [spc]
  182.         33
  183.         273
  184.         1
  185.         0
  186.         0
  187.         1
  188.         100
  189.     [brk]
  190.         4
  191.     [line]
  192.         8
  193.         0
  194.         1
  195.         0
  196.         1
  197.         1
  198.         1
  199.         10
  200.         10
  201.         1
  202.     [spec]
  203.         0
  204.         0
  205.         <*0>
  206.         360
  207.         1
  208.         1
  209.         0
  210.         0
  211.         0
  212.         0
  213.     [nfmt]
  214.         272
  215.         1
  216.         2
  217.         .
  218.         ,
  219.         $
  220.     Bullet
  221.     0
  222.     0
  223. [tag]
  224.     Bullet 1
  225.     5
  226.     [fnt]
  227.         Times New Roman
  228.         240
  229.         0
  230.         49152
  231.     [algn]
  232.         1
  233.         1
  234.         288
  235.         288
  236.         288
  237.     [spc]
  238.         33
  239.         273
  240.         1
  241.         0
  242.         0
  243.         1
  244.         100
  245.     [brk]
  246.         4
  247.     [line]
  248.         8
  249.         0
  250.         1
  251.         0
  252.         1
  253.         1
  254.         1
  255.         10
  256.         10
  257.         1
  258.     [spec]
  259.         0
  260.         0
  261.         <*5>
  262.         0
  263.         1
  264.         1
  265.         0
  266.         0
  267.         0
  268.         0
  269.     [nfmt]
  270.         280
  271.         1
  272.         2
  273.         .
  274.         ,
  275.         $
  276.     Bullet 1
  277.     0
  278.     0
  279. [tag]
  280.     Number List
  281.     6
  282.     [fnt]
  283.         Times New Roman
  284.         240
  285.         0
  286.         49152
  287.     [algn]
  288.         1
  289.         1
  290.         360
  291.         360
  292.         360
  293.     [spc]
  294.         33
  295.         273
  296.         1
  297.         0
  298.         0
  299.         1
  300.         100
  301.     [brk]
  302.         4
  303.     [line]
  304.         8
  305.         0
  306.         1
  307.         0
  308.         1
  309.         1
  310.         1
  311.         10
  312.         10
  313.         1
  314.     [spec]
  315.         0
  316.         0
  317.         <*:>.
  318.         360
  319.         1
  320.         1
  321.         0
  322.         16
  323.         0
  324.         0
  325.     [nfmt]
  326.         272
  327.         1
  328.         2
  329.         .
  330.         ,
  331.         $
  332.     Number List
  333.     0
  334.     0
  335. [tag]
  336.     Subhead
  337.     7
  338.     [fnt]
  339.         Times New Roman
  340.         240
  341.         0
  342.         49155
  343.     [algn]
  344.         1
  345.         1
  346.         0
  347.         0
  348.         0
  349.     [spc]
  350.         33
  351.         273
  352.         1
  353.         72
  354.         72
  355.         1
  356.         100
  357.     [brk]
  358.         68
  359.     [line]
  360.         8
  361.         0
  362.         1
  363.         0
  364.         1
  365.         1
  366.         1
  367.         10
  368.         10
  369.         1
  370.     [spec]
  371.         0
  372.         1
  373.         
  374.         0
  375.         1
  376.         1
  377.         0
  378.         0
  379.         0
  380.         0
  381.     [nfmt]
  382.         272
  383.         1
  384.         2
  385.         .
  386.         ,
  387.         $
  388.     Body Text
  389.     0
  390.     0
  391. [tag]
  392.     Title
  393.     8
  394.     [fnt]
  395.         Arial
  396.         360
  397.         0
  398.         16385
  399.     [algn]
  400.         4
  401.         1
  402.         0
  403.         0
  404.         0
  405.     [spc]
  406.         33
  407.         446
  408.         1
  409.         144
  410.         72
  411.         1
  412.         100
  413.     [brk]
  414.         16
  415.     [line]
  416.         8
  417.         0
  418.         1
  419.         0
  420.         1
  421.         1
  422.         1
  423.         10
  424.         10
  425.         1
  426.     [spec]
  427.         0
  428.         0
  429.         
  430.         0
  431.         1
  432.         1
  433.         0
  434.         0
  435.         0
  436.         0
  437.     [nfmt]
  438.         272
  439.         1
  440.         2
  441.         .
  442.         ,
  443.         $
  444.     Title
  445.     0
  446.     0
  447. [tag]
  448.     Header
  449.     9
  450.     [fnt]
  451.         Times New Roman
  452.         240
  453.         0
  454.         49152
  455.     [algn]
  456.         1
  457.         1
  458.         0
  459.         0
  460.         0
  461.     [spc]
  462.         33
  463.         273
  464.         1
  465.         0
  466.         0
  467.         1
  468.         100
  469.     [brk]
  470.         4
  471.     [line]
  472.         8
  473.         0
  474.         1
  475.         0
  476.         1
  477.         1
  478.         1
  479.         10
  480.         10
  481.         1
  482.     [spec]
  483.         0
  484.         0
  485.         
  486.         0
  487.         1
  488.         1
  489.         0
  490.         0
  491.         0
  492.         0
  493.     [nfmt]
  494.         280
  495.         1
  496.         2
  497.         .
  498.         ,
  499.         $
  500.     Header
  501.     0
  502.     0
  503. [tag]
  504.     Footer
  505.     11
  506.     [fnt]
  507.         Times New Roman
  508.         240
  509.         0
  510.         49152
  511.     [algn]
  512.         1
  513.         1
  514.         0
  515.         0
  516.         0
  517.     [spc]
  518.         33
  519.         273
  520.         1
  521.         0
  522.         0
  523.         1
  524.         100
  525.     [brk]
  526.         4
  527.     [line]
  528.         8
  529.         0
  530.         1
  531.         0
  532.         1
  533.         1
  534.         1
  535.         10
  536.         10
  537.         1
  538.     [spec]
  539.         0
  540.         0
  541.         
  542.         0
  543.         1
  544.         1
  545.         0
  546.         0
  547.         0
  548.         0
  549.     [nfmt]
  550.         280
  551.         1
  552.         2
  553.         .
  554.         ,
  555.         $
  556.     Footer
  557.     0
  558.     0
  559. [lay]
  560.     Standard
  561.     513
  562.     [rght]
  563.         15840
  564.         12240
  565.         1
  566.         576
  567.         720
  568.         1
  569.         1080
  570.         576
  571.         0
  572.         1
  573.         0
  574.         1
  575.         0
  576.         2
  577.         1
  578.         576
  579.         11664
  580.         12
  581.         1
  582.         720
  583.         1
  584.         1440
  585.         1
  586.         2160
  587.         1
  588.         2880
  589.         1
  590.         3600
  591.         1
  592.         4320
  593.         1
  594.         5040
  595.         1
  596.         5760
  597.         1
  598.         6480
  599.         1
  600.         7200
  601.         1
  602.         7920
  603.         1
  604.         8640
  605.     [hrght]
  606.     [lyfrm]
  607.         1
  608.         11200
  609.         0
  610.         0
  611.         12240
  612.         1080
  613.         0
  614.         1
  615.         3
  616.         1 0 0 0 0 0 0
  617.         0
  618.         0
  619.         1
  620.     [frmlay]
  621.         1080
  622.         12240
  623.         1
  624.         1440
  625.         72
  626.         1
  627.         792
  628.         1440
  629.         0
  630.         1
  631.         0
  632.         1
  633.         1
  634.         0
  635.         1
  636.         1440
  637.         10800
  638.         2
  639.         2
  640.         4680
  641.         3
  642.         9360
  643.     [txt]
  644. >
  645.     [frght]
  646.     [lyfrm]
  647.         1
  648.         13248
  649.         0
  650.         15120
  651.         12240
  652.         15840
  653.         0
  654.         1
  655.         3
  656.         1 0 0 0 0 0 0
  657.         0
  658.         0
  659.         2
  660.     [frmlay]
  661.         15840
  662.         12240
  663.         1
  664.         1440
  665.         648
  666.         1
  667.         15192
  668.         1440
  669.         0
  670.         1
  671.         0
  672.         1
  673.         1
  674.         0
  675.         1
  676.         1440
  677.         10800
  678.         2
  679.         2
  680.         4680
  681.         3
  682.         9360
  683.     [txt]
  684. >
  685. [elay]
  686. [l1]
  687.     0
  688. [pg]
  689.     8
  690.     48 0 0 0 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  691.     96 0 14 0 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  692.     144 0 0 0 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  693.     170 0 5 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  694.     218 0 38 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  695.     264 0 39 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  696.     312 0 49 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  697.     337 0 10 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  698. [edoc]
  699. <:#284,11088>
  700.  
  701. <:#284,11088>
  702.  
  703. <:#284,11088>
  704.  
  705. <:#284,11088>
  706.  
  707. <:#284,11088>' Declare functions
  708.  
  709. <:#284,11088>Declare    FontDlg(Action, Hdlg, id)
  710.  
  711. <:#284,11088>Declare    CellEngine(action,Form)
  712.  
  713. <:#284,11088>Declare    StrPath(Filename)
  714.  
  715. <:#284,11088>Declare    SizeBox(Hdlg, NumberEditControls)
  716.  
  717. <:#284,11088>Declare GetFormats(Action)
  718.  
  719. <:#284,11088>
  720.  
  721. <:#284,11088>' WinApi defines
  722.  
  723. <:#284,11088>Define SetWindowText(hwnd, text)    DllCall("user,SetWindowText,IHC", %1, %2)
  724.  
  725. <:#284,11088>Define MoveWindow() DllCall("User,MoveWindow,HHHHHHA",%1,%2,%3,%4,%5,%6)
  726.  
  727. <:#284,11088>DEFINE GetWindowRect()    DllCall("user,GetWindowRect,HHN",%1,%2)
  728.  
  729. <:#284,11088>Define ShowWindow(hWnd, stuff) DllCall("user,ShowWindow,HHH", %1, %2)
  730.  
  731. <:#284,11088>Define getsystemmetrics() dllcall("user,getsystemmetrics,HH", %1)
  732.  
  733. <:#284,11088>
  734.  
  735. <:#284,11088>
  736.  
  737. <:#284,11088>Define    GetPrefix()    GetGlobalVar$("Prefix")
  738.  
  739. <:#284,11088>Define    GetSuffix()    GetGlobalVar$("Suffix")
  740.  
  741. <:#284,11088>
  742.  
  743. <:#284,11088>
  744.  
  745. @Subhead@<:#284,11088>Function Main()
  746.  
  747. <:#284,11088>DefStr hInstance;
  748.  
  749. <:#284,11088>
  750.  
  751. <:#284,11088>
  752.  
  753. <:#284,11088>Mac = GetRunningMacroFile$()
  754.  
  755. <:#284,11088>MacPath = StrPath(Mac)
  756.  
  757. <:#284,11088>FontDlg(1,0,0)
  758.  
  759. <:#284,11088>CellEngine(1,0)
  760.  
  761. <:#284,11088>GetFormats(1)
  762.  
  763. <:#284,11088>FillEdit(1000, HelpText)
  764.  
  765. <:#284,11088>SetDlgCallBack(0,"{Mac}!InitDlg")
  766.  
  767. <:#284,11088>For Id = 8001 to 8009
  768.  
  769. <:#284,11088>    SetDlgCallBack(Id, "{Mac}!DataChange")
  770.  
  771. <:#284,11088>Next
  772.  
  773. <:#284,11088>
  774.  
  775. <:#284,11088>FillEdit(1001, Value1Text)
  776.  
  777. <:#284,11088>FillEdit(1002, Value2Text)
  778.  
  779. <:#284,11088>FillEdit(1003, Value3Text)
  780.  
  781. <:#284,11088>FillEdit(1004, Value4Text)
  782.  
  783. <:#284,11088>FillEdit(1005, Value5Text)
  784.  
  785. <:#284,11088>FillEdit(1006, Value6Text)
  786.  
  787. <:#284,11088>FillEdit(1007, Value7Text)
  788.  
  789. <:#284,11088>FillEdit(1008, Value8Text)
  790.  
  791. <:#284,11088>FillEdit(1009, Value9Text)
  792.  
  793. <:#284,11088>
  794.  
  795. <:#284,11088>
  796.  
  797. <:#284,11088>Box = DialogBox(".","Deprec")
  798.  
  799. <:#284,11088>If Box = 3
  800.  
  801. <:#284,11088>    ' box closed with the copy button
  802.  
  803. <:#284,11088>    Answer = GetDialogField$(8010)
  804.  
  805. <:#284,11088>    ClipBoardWrite(Answer,1)
  806.  
  807. <:#284,11088>Endif
  808.  
  809. <:#284,11088>
  810.  
  811. <:#284,11088>FontDlg(4,0,0)
  812.  
  813. <:#284,11088>CellEngine(0,0)
  814.  
  815. <:#284,11088>GetFormats(0)
  816.  
  817. <:#284,11088>End function
  818.  
  819. <:#284,11088>
  820.  
  821. <:#284,11088>
  822.  
  823. @Subhead@<:#284,11088>Function DataChange(Hdlg, id, value)
  824.  
  825. <:#284,11088>IgnoreKeyBoard(2)
  826.  
  827. <:#284,11088>DefStr Allowance;
  828.  
  829. <:#284,11088>Value1 = GetDlgItemText(hDlg, 8001) * 1
  830.  
  831. <:#284,11088>Value2 = GetDlgItemText(hDlg, 8002) * 1
  832.  
  833. <:#284,11088>value3 = GetDlgItemText(hDlg, 8003) * 1
  834.  
  835. <:#284,11088>value4 = GetDlgItemText(hDlg, 8004) * 1
  836.  
  837. <:#284,11088>value5 = GetDlgItemText(hDlg, 8005) * 1
  838.  
  839. <:#284,11088>value6 = GetDlgItemText(hdlg, 8006) * 1
  840.  
  841. <:#284,11088>value7 = GetDlgItemText(hdlg, 8007) * 1
  842.  
  843. <:#284,11088>value8 = GetDlgItemText(hdlg, 8008) * 1
  844.  
  845. <:#284,11088>value9 = GetDlgItemText(hdlg, 8009) * 1
  846.  
  847. <:#284,11088>Answer = CellEngine(3,Formula)      
  848.  
  849. <:#284,11088>Answer = FormatNum$("","",2,Answer )
  850.  
  851. <:#284,11088>SetDlgItemText(hDlg, 8010, Answer)
  852.  
  853. <:#284,11088>End Function
  854.  
  855. <:#284,11088>
  856.  
  857. @Subhead@<:#284,11088>Function InitDlg(hDlg, id, value)
  858.  
  859. <:#284,11088>' use the fontdlg function to display the following control with a small font
  860.  
  861. <:#284,11088>HourGlass(on)
  862.  
  863. <:#284,11088>SetWindowText(Hdlg, DialogTitle)
  864.  
  865. <:#284,11088>FontDlg(3, Hdlg, 1000)
  866.  
  867. <:#284,11088>For Id = 1 to 9
  868.  
  869. <:#284,11088>    FontDlg(3, Hdlg, id + 1000)
  870.  
  871. <:#284,11088>    FontDlg(3, Hdlg, id + 8000)
  872.  
  873. <:#284,11088>    If Id <;> NumberItems
  874.  
  875. <:#284,11088>        ShowWindow(GetDlgItem(Hdlg, id + 1000), 0)
  876.  
  877. <:#284,11088>        ShowWindow(GetDlgItem(Hdlg, id + 8000), 0)
  878.  
  879. <:#284,11088>    Endif
  880.  
  881. <:#284,11088>Next
  882.  
  883. <:#284,11088>FontDlg(3, Hdlg, 8010)
  884.  
  885. <:#284,11088>FontDlg(3, Hdlg, 8011)
  886.  
  887. <:#284,11088>SizeBox(Hdlg, NumberItems)
  888.  
  889. <:#284,11088>HourGlass(off)
  890.  
  891. <:#284,11088>
  892.  
  893. <:#284,11088>End Function
  894.  
  895. <:#284,11088>
  896.  
  897. <:#284,11088>
  898.  
  899. @Subhead@<:#284,11088>Function SizeBox(Hdlg, NumberEditControls)
  900.  
  901. <:#284,11088>Define    Repaint 1
  902.  
  903. <:#284,11088>Dim Rect(4)
  904.  
  905. Stat = GetSystemMetrics(4)
  906.  
  907. GetWindowRect(Hdlg, &Rect)
  908.  
  909. <:#284,11088>DeltaX = Rect(3) - Rect(1);
  910.  
  911. <:#284,11088>NumberIncrease = (NumberEditControls - 3);    
  912.  
  913. <:#284,11088>If NumberIncrease <<0
  914.  
  915. <:#284,11088>    NumberIncrease = 0
  916.  
  917. <:#284,11088>Endif
  918.  
  919. If Stat = 20
  920.  
  921.     DeltaY = (20 * NumberIncrease) + 140;
  922.  
  923. Else
  924.  
  925.     DeltaY = (26 * NumberIncrease) + 190;
  926.  
  927. Endif
  928.  
  929. MoveWindow(Hdlg, Rect(1), Rect(2), DeltaX, DeltaY, Repaint)
  930.  
  931. <:#284,11088>End Function
  932.  
  933. <:#284,11088>
  934.  
  935. <:#284,11088>
  936.  
  937. @Subhead@<:#284,11088>Function GetFormats(Action)
  938.  
  939. <:#284,11088>iCurrency = GetProfileString$("Intl","iCurrency","Win.ini")
  940.  
  941. <:#284,11088>currency = GetProfileString$("Intl","sCurrency","Win.ini")
  942.  
  943. <:#284,11088>AllocGlobalVar("Prefix",1)
  944.  
  945. <:#284,11088>AllocGlobalVar("Suffix",1)
  946.  
  947. <:#284,11088>
  948.  
  949. <:#284,11088>Switch Action
  950.  
  951. <:#284,11088>    Case 1     ' turn this on
  952.  
  953. <:#284,11088>        Switch iCurrency
  954.  
  955. <:#284,11088>            Case 0
  956.  
  957. <:#284,11088>                Prefix = Currency
  958.  
  959. <:#284,11088>                Suffix = ""
  960.  
  961. <:#284,11088>            Case 1
  962.  
  963. <:#284,11088>                Prefix = ""
  964.  
  965. <:#284,11088>                Suffix = Currency
  966.  
  967. <:#284,11088>            Case 2
  968.  
  969. <:#284,11088>                Prefix = StrCat$(Currency," ")
  970.  
  971. <:#284,11088>                Suffix = ""
  972.  
  973. <:#284,11088>            Case 3
  974.  
  975. <:#284,11088>                Prefix = ""
  976.  
  977. <:#284,11088>                Suffix = StrCat$(" ",Currency)
  978.  
  979. <:#284,11088>        endSwitch
  980.  
  981. <:#284,11088>        SetGlobalVar("Suffix",Suffix)
  982.  
  983. <:#284,11088>        SetGlobalVar("Prefix",Prefix)
  984.  
  985. <:#284,11088>
  986.  
  987. <:#284,11088>    Case 0    ' free globals
  988.  
  989. <:#284,11088>        FreeGlobalVar("Suffix")
  990.  
  991. <:#284,11088>        FreeGlobalVar("Prefix")
  992.  
  993. <:#284,11088>        
  994.  
  995. <:#284,11088>EndSwitch
  996.  
  997. <:#284,11088>End Function
  998.  
  999. <:#284,11088>
  1000.  
  1001. <:#284,11088>
  1002.  
  1003. <:#284,11088>
  1004.  
  1005. @Subhead@<:#284,11088>function strpath(filename)
  1006.  
  1007. <:#284,11088>defstr char;
  1008.  
  1009. <:#284,11088>Length = len(FileName)
  1010.  
  1011. <:#284,11088>WHILE "\" != Assign(&Char, MID$(FileName, Length, 1))
  1012.  
  1013. <:#284,11088>    Length = Length - 1
  1014.  
  1015. <:#284,11088>WEND
  1016.  
  1017. <:#284,11088>InFileName = Right$(FileName, (len(FileName) - Length))
  1018.  
  1019. <:#284,11088>InDir = Left$(FileName, Length - 1) 
  1020.  
  1021. <:#284,11088>if right$(indir, 1) <<<;> "\"
  1022.  
  1023. <:#284,11088>    indir = strcat$(indir, "\")
  1024.  
  1025. <:#284,11088>endif
  1026.  
  1027. <:#284,11088>return indir
  1028.  
  1029. <:#284,11088>end function
  1030.  
  1031. <:#284,11088>
  1032.  
  1033. <:#284,11088>
  1034.  
  1035. <:#284,11088>
  1036.  
  1037. <:p<* >>
  1038.  
  1039. @Subhead@<:#284,11088>Function CellEngine(Action,Form)
  1040.  
  1041. <:#284,11088>'Available Actions
  1042.  
  1043. <:#284,11088>'    1         Start the engine and allocate globalvar
  1044.  
  1045. <:#284,11088>'    2        Return the handle to the instance of the sheet
  1046.  
  1047. <:#284,11088>'    3        Pass the formula as the second param
  1048.  
  1049. <:#284,11088>'    0        Shut everything down
  1050.  
  1051. <:#284,11088>'    Default    Expect a formula and return an answer
  1052.  
  1053. <:#284,11088>
  1054.  
  1055. <:#284,11088>' these defines may be useful at the beginning of your macro
  1056.  
  1057. <:#284,11088>Define StartEngine    1
  1058.  
  1059. <:#284,11088>Define GetInstance    2
  1060.  
  1061. <:#284,11088>Define CloseEngine    0
  1062.  
  1063. <:#284,11088>
  1064.  
  1065. <:#284,11088>Define    CECREATEINSTANCE(LPHANDLE)    DllCall("LTSCE01.DLL,CECREATEINSTANCE,HO",%1)
  1066.  
  1067. <:#284,11088>Define    CEDESTROYINSTANCE(HANDLE)    DllCall("LTSCE01.DLL,CEDESTROYINSTANCE,HH",%1)
  1068.  
  1069. <:#568,11088>Define    CECALCNOW(HINSTANCE, lpFormula, lpOutPut)    DllCall("LTSCE01.DLL,CECALCNOW,HHCC",%1,%2,%3)
  1070.  
  1071. <:#284,11088>
  1072.  
  1073. <:#284,11088>DefStr hInstance, Answer, Var;
  1074.  
  1075. <:#284,11088>Mac = GetRunningMacroFile$()
  1076.  
  1077. <:#284,11088>GlobalInstance = StrCat$(Mac,"hIstance")
  1078.  
  1079. <:#284,11088>AmiDir = GetAmiDirectory$()
  1080.  
  1081. <:#284,11088>
  1082.  
  1083. <:#284,11088>Switch Action
  1084.  
  1085. <:#284,11088>    Case 1
  1086.  
  1087. <:#284,11088>        ' start the engine
  1088.  
  1089. <:#284,11088>        LibId = DLLLoadLib("{AmiDir}LTSCE01.DLL","CECreateInstance","HO")
  1090.  
  1091. <:#284,11088>        If LibId = 0
  1092.  
  1093. <:#284,11088>            Message("LTSCE01.DLL not found.  Copy the dll to your Ami Pro Directory.")    
  1094.  
  1095. <:#284,11088>            Return -1;
  1096.  
  1097. <:#284,11088>        Endif
  1098.  
  1099. <:#284,11088>        RetVal = CECREATEINSTANCE(&hInstance)
  1100.  
  1101. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1102.  
  1103. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1104.  
  1105. <:#284,11088>        SetGlobalVar("{Mac}Libid",LibId)
  1106.  
  1107. <:#284,11088>        SetGlobalVar("{GlobalInstance}",hInstance)
  1108.  
  1109. <:#284,11088>        Return hInstance;
  1110.  
  1111. <:#284,11088>        Break;
  1112.  
  1113. <:#284,11088>
  1114.  
  1115. <:#284,11088>    Case 2
  1116.  
  1117. <:#284,11088>        ' return the handle to the instance of the sheet
  1118.  
  1119. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1120.  
  1121. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1122.  
  1123. <:#284,11088>        Return hInstance;
  1124.  
  1125. <:#284,11088>        Break;
  1126.  
  1127. <:#284,11088>
  1128.  
  1129. <:#284,11088>    Case 3
  1130.  
  1131. <:#284,11088>        ' Calculate the formula and return the answer
  1132.  
  1133. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1134.  
  1135. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1136.  
  1137. <:#284,11088>        CECalcNow(hInstance,"{Form}",&Answer)
  1138.  
  1139. <:#284,11088>        Return Answer;
  1140.  
  1141. <:#284,11088>        Break;
  1142.  
  1143. <:#284,11088>    
  1144.  
  1145. <:#284,11088>
  1146.  
  1147. <:#284,11088>    Case 0
  1148.  
  1149. <:#284,11088>        ' destroy the instance of the sheet and free the global var and libid
  1150.  
  1151. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1152.  
  1153. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1154.  
  1155. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1156.  
  1157. <:#284,11088>        LibId = GetGlobalVar$("{Mac}LibId")
  1158.  
  1159. <:#284,11088>        If hInstance
  1160.  
  1161. <:#284,11088>            CEDestroyInstance(hInstance)
  1162.  
  1163. <:#284,11088>            DllFreeLib(Libid)
  1164.  
  1165. <:#284,11088>        Endif
  1166.  
  1167. <:#284,11088>        FreeGlobalVar("{GlobalInstance}")
  1168.  
  1169. <:#284,11088>        FreeGlobalVar("{Mac}LibId")
  1170.  
  1171. <:#284,11088>        Break;
  1172.  
  1173. <:#284,11088>
  1174.  
  1175. <:#284,11088>    Default
  1176.  
  1177. <:#284,11088>EndSwitch
  1178.  
  1179. <:#284,11088>End Function
  1180.  
  1181. <:#284,11088>
  1182.  
  1183. <:#284,11088>
  1184.  
  1185. <:#284,11088>
  1186.  
  1187. <:#284,11088>
  1188.  
  1189. <:#284,11088>
  1190.  
  1191. @Subhead@<:#284,11088>Function FontDlg(Action, Hdlg, id)
  1192.  
  1193. <:#284,11088>' 1    Create a font and allocvar
  1194.  
  1195. <:#284,11088>' 2    Return the handle of the create font 
  1196.  
  1197. <:#284,11088>' 3    Set the id specified to the font
  1198.  
  1199. <:#284,11088>' 4    Freeglobalvar and delete created object
  1200.  
  1201. <:#284,11088>
  1202.  
  1203. @Outline2@<:#568,11088>define    CreateFontDLG()        DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
  1204.  
  1205. @Outline2@<:#284,11088>define    DeleteObjectDLG(handle)    DllCall("gdi,DeleteObject,HH", %1)
  1206.  
  1207. @Outline2@<:#568,11088>define    SendMessageDLG(hwnd, msg, wpara, lparm)    DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
  1208.  
  1209. @Outline2@<:#284,11088>
  1210.  
  1211. @Outline2@<:#284,11088>Mac = GetRunningMacroFile$()
  1212.  
  1213. @Outline2@<:#284,11088>
  1214.  
  1215. <:#284,11088>Switch Action
  1216.  
  1217. <:#284,11088>    Case 1    ' Create the font and store it
  1218.  
  1219. @Outline2@<:#284,11088>        Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
  1220.  
  1221. <:#284,11088>        AllocGlobalVar("{Mac}FontHandle",1)
  1222.  
  1223. <:#284,11088>        If Font
  1224.  
  1225. <:#284,11088>            SetGlobalVar("{Mac}FontHandle",Font)
  1226.  
  1227. <:#284,11088>            Return Font
  1228.  
  1229. <:#284,11088>        Else
  1230.  
  1231. <:#284,11088>            Return 0;    ' no font
  1232.  
  1233. <:#284,11088>        Endif
  1234.  
  1235. <:#284,11088>        Break;
  1236.  
  1237. <:#284,11088>    Case 2    ' Return the handle to the font
  1238.  
  1239. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1240.  
  1241. <:#284,11088>        If Handle 
  1242.  
  1243. <:#284,11088>            Return Handle
  1244.  
  1245. <:#284,11088>        Else
  1246.  
  1247. <:#284,11088>            Return 0
  1248.  
  1249. <:#284,11088>        Endif
  1250.  
  1251. <:#284,11088>
  1252.  
  1253. <:#284,11088>    Case 3    ' Set the id to the font
  1254.  
  1255. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1256.  
  1257. <:#284,11088>        If Handle 
  1258.  
  1259. <:#284,11088>            IdControl = GetDlgITem(Hdlg, id)
  1260.  
  1261. <:#284,11088>            SendMessageDlg(idControl, 0x30, Handle, 0)
  1262.  
  1263. <:#284,11088>            Return 1
  1264.  
  1265. <:#284,11088>        Else
  1266.  
  1267. <:#284,11088>            Return 0
  1268.  
  1269. <:#284,11088>        Endif
  1270.  
  1271. <:#284,11088>        Break;        
  1272.  
  1273. <:#284,11088>        
  1274.  
  1275. <:#284,11088>    Case 4    ' Delete the font and clear the var
  1276.  
  1277. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1278.  
  1279. <:#284,11088>        If Handle
  1280.  
  1281. <:#284,11088>            DeleteObjectDLG(Handle)
  1282.  
  1283. <:#284,11088>            Stat = 1    
  1284.  
  1285. <:#284,11088>        Else
  1286.  
  1287. <:#284,11088>            Stat = 0
  1288.  
  1289. <:#284,11088>        Endif
  1290.  
  1291. <:#284,11088>        FreeGlobalVar("{Mac}FontHandle")
  1292.  
  1293. <:#284,11088>        Return Stat        
  1294.  
  1295. <:#284,11088>    Default
  1296.  
  1297. <:#284,11088>        Message("Fontdlg received an invalid parameter {Action}")
  1298.  
  1299. <:#284,11088>EndSwitch    
  1300.  
  1301. <:#284,11088>
  1302.  
  1303. <:#284,11088>End Function
  1304.  
  1305. <:#284,11088>
  1306.  
  1307. @Subhead@<:#284,11088>
  1308.  
  1309. <:#284,11088>
  1310.  
  1311. <:#284,11088>
  1312.  
  1313. <:#284,11088>
  1314.  
  1315. <:#284,11088>
  1316.  
  1317. <:#284,11088>
  1318.  
  1319. <:#284,11088>DIALOG    Deprec
  1320.  
  1321. <:#284,11088>-2134376448    23    78    50    158    159    ""    ""    "Dialog Title"
  1322.  
  1323. <:#284,11088>FONT    8    "Helv"
  1324.  
  1325. <:#284,11088>60    28    33    12    8001    1350631552    "edit"    ""    0 
  1326.  
  1327. <:#284,11088>60    42    33    12    8002    1350631552    "edit"    ""    0 
  1328.  
  1329. <:#284,11088>60    56    33    12    8003    1350631552    "edit"    ""    0 
  1330.  
  1331. <:#284,11088>60    70    33    12    8004    1350631552    "edit"    ""    0 
  1332.  
  1333. <:#284,11088>60    84    33    12    8005    1350631552    "edit"    ""    0 
  1334.  
  1335. <:#284,11088>60    98    33    12    8006    1350631552    "edit"    ""    0 
  1336.  
  1337. <:#284,11088>60    112    33    12    8007    1350631552    "edit"    ""    0 
  1338.  
  1339. <:#284,11088>60    126    33    12    8008    1350631552    "edit"    ""    0 
  1340.  
  1341. <:#284,11088>60    140    33    12    8009    1350631552    "edit"    ""    0 
  1342.  
  1343. <:#284,11088>114    3    40    14    1    1342373889    "button"    "OK"    0 
  1344.  
  1345. <:#284,11088>114    19    40    14    3    1342373888    "button"    "Copy"    0 
  1346.  
  1347. <:#284,11088>106    52    38    8    8010    1342177282    "static"    ""    0 
  1348.  
  1349. <:#284,11088>98    39    57    29    20    1342177287    "button"    "Answer"    0 
  1350.  
  1351. <:#284,11088>4    2    103    24    1000    1342177280    "static"    ""    0 
  1352.  
  1353. <:#284,11088>4    30    56    8    1001    1342177280    "static"    "value1text"    0 
  1354.  
  1355. <:#284,11088>4    44    56    8    1002    1342177280    "static"    "value2text"    0 
  1356.  
  1357. <:#284,11088>4    58    56    8    1003    1342177280    "static"    "value3text"    0 
  1358.  
  1359. <:#284,11088>4    72    56    8    1004    1342177280    "static"    "value4text"    0 
  1360.  
  1361. <:#284,11088>4    86    56    8    1005    1342177280    "static"    "value5text"    0 
  1362.  
  1363. <:#284,11088>3    99    56    8    1006    1342177280    "static"    "value6text"    0 
  1364.  
  1365. <:#284,11088>3    111    56    8    1007    1342177280    "static"    "value7text"    0 
  1366.  
  1367. <:#284,11088>2    123    56    8    1008    1342177280    "static"    "value8text"    0 
  1368.  
  1369. <:#284,11088>1    141    56    8    1009    1342177280    "static"    "value9text"    0 
  1370.  
  1371. <:#284,11088>END DIALOG
  1372.  
  1373. >
  1374.  
  1375. [Embedded]
  1376. 00019011
  1377.